/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package supportlearning.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Khin
 */
@Entity
@Table(name = "FeedBack", catalog = "SupportLearningDB", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FeedBack.findAll", query = "SELECT f FROM FeedBack f"),
    @NamedQuery(name = "FeedBack.findByFbId", query = "SELECT f FROM FeedBack f WHERE f.fbId = :fbId"),
    @NamedQuery(name = "FeedBack.findByFbQuestion", query = "SELECT f FROM FeedBack f WHERE f.fbQuestion = :fbQuestion"),
    @NamedQuery(name = "FeedBack.findByFbAnwser", query = "SELECT f FROM FeedBack f WHERE f.fbAnwser = :fbAnwser"),
    @NamedQuery(name = "FeedBack.findByFbDateReply", query = "SELECT f FROM FeedBack f WHERE f.fbDateReply = :fbDateReply"),
    @NamedQuery(name = "FeedBack.findByStatus", query = "SELECT f FROM FeedBack f WHERE f.status = :status")})
public class FeedBack implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "FbId", nullable = false)
    private Integer fbId;
    @Basic(optional = false)
    @Column(name = "FbQuestion", nullable = false, length = 200)
    private String fbQuestion;
    @Column(name = "FbAnwser", length = 500)
    private String fbAnwser;
    @Column(name = "FbDateReply")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fbDateReply;
    @Basic(optional = false)
    @Column(name = "Status", nullable = false)
    private boolean status;
    @JoinColumn(name = "StudentId", referencedColumnName = "StudentId", nullable = false)
    @ManyToOne(optional = false)
    private StudentProfile studentId;
    @JoinColumn(name = "StaffId", referencedColumnName = "StaffId", nullable = false)
    @ManyToOne(optional = false)
    private StaffProfile staffId;

    public FeedBack() {
    }

    public FeedBack(Integer fbId) {
        this.fbId = fbId;
    }

    public FeedBack(Integer fbId, String fbQuestion, boolean status) {
        this.fbId = fbId;
        this.fbQuestion = fbQuestion;
        this.status = status;
    }

    public Integer getFbId() {
        return fbId;
    }

    public void setFbId(Integer fbId) {
        this.fbId = fbId;
    }

    public String getFbQuestion() {
        return fbQuestion;
    }

    public void setFbQuestion(String fbQuestion) {
        this.fbQuestion = fbQuestion;
    }

    public String getFbAnwser() {
        return fbAnwser;
    }

    public void setFbAnwser(String fbAnwser) {
        this.fbAnwser = fbAnwser;
    }

    public Date getFbDateReply() {
        return fbDateReply;
    }

    public void setFbDateReply(Date fbDateReply) {
        this.fbDateReply = fbDateReply;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public StudentProfile getStudentId() {
        return studentId;
    }

    public void setStudentId(StudentProfile studentId) {
        this.studentId = studentId;
    }

    public StaffProfile getStaffId() {
        return staffId;
    }

    public void setStaffId(StaffProfile staffId) {
        this.staffId = staffId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fbId != null ? fbId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FeedBack)) {
            return false;
        }
        FeedBack other = (FeedBack) object;
        if ((this.fbId == null && other.fbId != null) || (this.fbId != null && !this.fbId.equals(other.fbId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "supportlearning.entity.FeedBack[ fbId=" + fbId + " ]";
    }
    
}
